Add standard icon names, and also fall back to builtin gtk stock icons.
authorMatthias Clasen <matthiasc@src.gnome.org>
Wed, 11 Jun 2008 03:17:55 +0000 (03:17 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 11 Jun 2008 03:17:55 +0000 (03:17 +0000)
        * gtk/gtkfilesystem.c (get_icon_for_special_directory):
        (gtk_file_system_volume_render_icon): Add standard icon names,
        and also fall back to builtin gtk stock icons.

svn path=/trunk/; revision=20350

ChangeLog
gtk/gtkfilesystem.c

index f49851e12ac8f5edce322a829ef848629384c54e..9e7cf10e1014f346466e5584422e14b3a7a6cd35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-10  Christian Persch  <chpe@gnome.org>
+
+       * gtk/gtkfilesystem.c (get_icon_for_special_directory):
+       (gtk_file_system_volume_render_icon): Add standard icon names,
+       and also fall back to builtin gtk stock icons.
+
 2008-06-10  Christian Persch  <chpe@gnome.org>
 
        * gtk/gtktreeview.c: (destroy_info), (set_destination_row),
index aa89a2c11514646cddb21da505b65f1461e3b9b6..027f1bb49cea1434cb5ea749cff93ecf7fb55e55 100644 (file)
@@ -1649,7 +1649,7 @@ get_pixbuf_from_gicon (GIcon      *icon,
   icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme,
                                              icon,
                                              icon_size,
-                                             0);
+                                             GTK_ICON_LOOKUP_USE_BUILTIN);
 
   if (!icon_info)
     return NULL;
@@ -1671,8 +1671,15 @@ get_icon_for_special_directory (GFile *file)
 
   if (g_file_equal (file, special_file))
     {
+      const char *names[] = { 
+        "user-desktop", 
+        "gnome-fs-desktop", 
+        "folder", 
+        "gtk-directory",
+        NULL 
+      };
       g_object_unref (special_file);
-      return g_themed_icon_new ("gnome-fs-desktop");
+      return g_themed_icon_new_from_names (names, -1);
     }
 
   g_object_unref (special_file);
@@ -1681,8 +1688,15 @@ get_icon_for_special_directory (GFile *file)
 
   if (g_file_equal (file, special_file))
     {
+      const char *names[] = { 
+        "user-home", 
+        "gnome-fs-home", 
+        "folder", 
+        "gtk-directory",
+        NULL 
+      };
       g_object_unref (special_file);
-      return g_themed_icon_new ("gnome-fs-home");
+      return g_themed_icon_new_from_names (names, -1);
     }
 
   g_object_unref (special_file);
@@ -1698,11 +1712,17 @@ gtk_file_system_volume_render_icon (GtkFileSystemVolume  *volume,
 {
   GIcon *icon = NULL;
   GdkPixbuf *pixbuf;
+  const char *harddisk_icons[] = { 
+    "drive-harddisk", 
+    "gnome-dev-harddisk", 
+    "gtk-harddisk",
+    NULL
+  };
 
   DEBUG ("volume_get_icon_name");
 
   if (IS_ROOT_VOLUME (volume))
-    icon = g_themed_icon_new ("gnome-dev-harddisk");
+    icon = g_themed_icon_new_from_names (harddisk_icons, -1);
   else if (G_IS_DRIVE (volume))
     icon = g_drive_get_icon (G_DRIVE (volume));
   else if (G_IS_VOLUME (volume))